﻿@namespace BootstrapBlazor.Components
@typeparam TModel
@inherits DialogBase<TModel>

@if (BodyTemplate != null)
{
    @BodyTemplate?.Invoke(Model)
    <div class="row mt-3">
        <div class="col-12">
            @RenderFooter
        </div>
    </div>
}
else
{
    <EditorForm TModel="TModel" Model="Model" Items="Items" RowType="RowType" ItemsPerRow="ItemsPerRow" LabelAlign="LabelAlign">
        <Buttons>
            @RenderFooter
        </Buttons>
    </EditorForm>
}

@code {
    RenderFragment RenderFooter =>
    @<div class="table-modal-footer">
        <Button Color="Color.Secondary" Icon="fa fa-trash-o" Text="@ResetButtonText" OnClickWithoutRender="@OnResetSearchClick" />
        <Button Color="Color.Primary" Icon="fa fa-search" Text="@QueryButtonText" OnClickWithoutRender="@OnSearchClick" />
    </div>;
}
